﻿@page "/BaseData/Works/Details/{id}"
@using WTM.ViewModel.BaseData.WorksVMs;
@inherits BasePage

<ValidateForm @ref="vform" Model="@Model" >
    <Row ItemsPerRow="ItemsPerRow.Two" RowType="RowType.Normal">

            <Display @bind-Value="@Model.Entity.work"   ShowLabel="true"/>
            <Display @bind-Value="@Model.Entity.Dwqy"   ShowLabel="true"/>
            <Display @bind-Value="@Model.Entity.Dwmc"   ShowLabel="true"/>
            <Display @bind-Value="@Model.Entity.Dwbm"   ShowLabel="true"/>
            <Display @bind-Value="@Model.Entity.Dwlx"   ShowLabel="true"/>
            <Display @bind-Value="@Model.Entity.Dwdz"   ShowLabel="true"/>
            <Display @bind-Value="@Model.Entity.Lxdh"   ShowLabel="true"/>
            <Display @bind-Value="@Model.Entity.Lxr"   ShowLabel="true"/>
            <WTUploadImage @bind-Value="@Model.Entity.PhotoId"  IsDisabled="true" ShowLabel="true"/>
            <Display @bind-Value="@Model.Entity.WorkNr"   ShowLabel="true"/>
            <Display @bind-Value="@Model.Entity.NlYq_1"   ShowLabel="true"/>
            <Display @bind-Value="@Model.Entity.NlYq_2"   ShowLabel="true"/>
            <Display @bind-Value="@Model.Entity.XbYq"   ShowLabel="true"/>
            <Display @bind-Value="@Model.Entity.WorkYq_1"   ShowLabel="true"/>
            <Display @bind-Value="@Model.Entity.WorkYq_2"   ShowLabel="true"/>
            <Display @bind-Value="@Model.Entity.Xzdy"   ShowLabel="true"/>
            <Display @bind-Value="@Model.Entity.Remark"   ShowLabel="true"/>
    </Row>
    <div class="modal-footer table-modal-footer">
        <Button Color="Color.Primary" Icon="fa fa-save" Text="@WtmBlazor.Localizer["Sys.Close"]" OnClick="OnClose" />
    </div>
</ValidateForm>

@code {

    private WorksVM Model = null;
    private ValidateForm vform { get; set; }
    [Parameter]
    public string id { get; set; }


    protected override async Task OnInitializedAsync()
    {

        var rv = await WtmBlazor.Api.CallAPI<WorksVM>($"/api/Works/{id}");
        Model = rv.Data;
    }

    public void OnClose()
    {
        CloseDialog();
    }

}
